package com.zidian.leader.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.zidian.leader.fragment.AttendanceRateFragment;
import com.zidian.leader.fragment.EvaluateRateFragment;

/**
 * 学生行为PagerAdapter
 * Created by GongCheng on 2017/2/15.
 */

public class StudentStatisticsPagerAdapter extends FragmentPagerAdapter {
    private static final String ATTENDANCE_RATE = "课程出勤率";
    private static final String EVA_COMPLETE_RATE = "评教完成率";

    public StudentStatisticsPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 0) {
            return AttendanceRateFragment.newInstance();
        } else {
            return EvaluateRateFragment.newInstance();
        }
    }

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        if (position == 0) {
            return ATTENDANCE_RATE;
        } else {
            return EVA_COMPLETE_RATE;
        }
    }
}
